<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <style>
        label {
            margin: 10px;
            font-size: 24px;
        }

        ul {
            margin-bottom: 10px;
        }

        ul li {
            margin: 5px 10px;
            padding: 5px;
            color: #000;
            word-wrap: break-word;
        }
    </style>
    <style> 
        html{width:100%;height:100%;} 
        body{background:#fff;font-size:18px;font-family:"Arial", "Tahoma", "微软雅黑", "雅黑";
        line-height:18px;padding:0px;margin:0px;text-align:center} 
        div{padding:18px} 
        img{border:0px;vertical-align:middle;padding:0;margin:0} 
        input, button{font-family:"Arial", "Tahoma", "微软雅黑", "雅黑";border:0;
        vertical-align:middle;margin:8px;line-height:18px;font-size:18px} 
        .btn{width:140px;height:36px;line-height:18px;font-size:18px;
        background:url("../icon/bg26.jpg") no-repeat left top;color:#FFF;padding-bottom:4px} 
    </style> 
    <style>
            input{
                border: 1px solid #ccc;
                padding: 7px 0px;
                border-radius: 3px;
                padding-left:5px;
                -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
                box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
                -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
                -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
                transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s
            }
            input:focus{
                    border-color: #66afe9;
                    outline: 0;
                    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
                    box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)
            }
    </style>
</head>

<body>
    <label>Hello APP</label>

    <div id="bt_log">
        <form name="myForm" action="" onsubmit="return validateForm()" method="post">
           <div><label>IP地址</label><input type="text" name="ip" value="192.168.8.248"></div>
            <div><label>端口号</label><input type="text" name="port" value="8080"></div>
            <div><input type="submit" class="btn" value="登录" onmouseover="this.style.backgroundPosition='left -36px'"
                onmouseout="this.style.backgroundPosition='left top'"></div>
        </form>

     </div>

    
    <div id='sys-info'></div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
    apiready = function() {

    };

    function validateForm() {
        var ip = document.forms["myForm"]["ip"].value;
        var port = document.forms["myForm"]["port"].value;
        if ((ip == "") && (port == "")) {
            alert("必须填写IP地址和端口号");
            return false;
        }else{
            //alert(ip +":"+ port);
            api.openWin({
                name: 'app',
                url: './user_app.html',
                pageParam:{
                    "_ip": ip,
                    "_port":port
                }
            });
            return true;
        }
    }
</script>

</html>
